Skip to content
This repository was archived by the owner on Mar 18, 2026. It is now read-only.

Add fast-forward workflow#8

Open
javdl wants to merge 1 commit intomainfrom
add-fast-forward
Open

Add fast-forward workflow#8
javdl wants to merge 1 commit intomainfrom
add-fast-forward

Conversation

@javdl
Copy link
Contributor

@javdl javdl commented Mar 12, 2026

Summary

  • Add GitHub Actions workflow for /fast-forward (and /ff alias) comment-triggered fast-forward merges
  • Add /rebase command for rebasing PR branches on the default branch
  • Uses dynamic default branch detection so it works regardless of whether the repo uses main or master

Context

This workflow enables maintainers to merge PRs via fast-forward by commenting /fast-forward or /ff on a PR. It also supports /rebase to rebase a PR branch on the default branch.

Requires the GH_PUSH_TOKEN org-level secret (already configured).

@javdl
Copy link
Contributor Author

javdl commented Mar 12, 2026

/fast-forward

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e435987d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


jobs:
fast-forward:
if: ${{ (contains(github.event.comment.body, '/fast-forward')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Parse slash command as an exact trigger

Using contains(github.event.comment.body, '/fast-forward') causes the merge job to run whenever that substring appears anywhere in a maintainer comment, so a message like please don't /fast-forward yet still executes the merge path. Because this workflow has write permissions, accidental mentions can mutate PR state unexpectedly; the condition should match an explicit command token rather than a substring.

Useful? React with 👍 / 👎.

- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(steps.get_pull_request_ref.outputs.data).head.ref }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Checkout the PR head repository before rebasing

The rebase flow checks out only head.ref but does not set repository, so actions/checkout targets github.repository (the base repo). For fork-based PRs, that branch exists only in the fork, so this step fails (or can resolve to an unrelated same-named branch in the base repo), preventing /rebase from working reliably for external contributions.

Useful? React with 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant